package view;

import java.awt.Color;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;

import presenter.GuiPresenter;
import presenter.IGuiPresenter;

import model.GuiData;

/**
 * @author  Natal Venetz
 */
public class GuiScreen extends JFrame implements IGuiView{

	private JDesktopPane desktop;
	
	/**
	 * @uml.property  name="guiPresenter"
	 * @uml.associationEnd  
	 */
	private IGuiPresenter guiPresenter;
	
	private GuiScreen() {
		
		guiPresenter = new GuiPresenter(this);
		
		guiPresenter.InitializeGui();
			
	}
	
	public static GuiScreen getInstance() {
		return new GuiScreen();
	}
	
	@Override
	public void InitializeView(GuiData viewData) {
		
		setTitle(viewData.getMainWindowName());
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		setSize(viewData.getMainWindowWidth(), viewData.getMainWindowHeight()-40);
		
		desktop = new JDesktopPane();
		setContentPane(desktop);
		
		desktop.add(LogScreen.getInstance());
		desktop.add(MapScreen.getInstance());
		
		desktop.setBackground(viewData.getBackgroundColor());
		
		setResizable(true);
		setVisible(true);
		
	}


}
